package com.example.demo.config;

import com.example.demo.interceptor.RemoveInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author hongjinhui
 */
@Configuration
public class MyWebMvcConfig implements WebMvcConfigurer {
    @Bean
    public MyWebMvcConfig getWebMvcConfigure() {
        MyWebMvcConfig myWebMvcConfig = new MyWebMvcConfig() {
            @Override
            public void addInterceptors(InterceptorRegistry registry) {
                registry.addInterceptor(new RemoveInterceptor()).addPathPatterns("/**");
            }
        };

        return myWebMvcConfig;
    }
}

